﻿using Microsoft.AspNetCore.Mvc;
using IService;
using cwatest.Dto;
using Model;

namespace cwatest.Controllers
{
    public class HomeController : ApiBase
    {
        private IHostSerice _host;
        public HomeController(IHostSerice hosted)
        {
            _host = hosted;
        }

        /// <summary>
        /// /
        /// </summary>
        /// <returns></returns>
        [HttpGet("{ID}")]
        public object Index(string ID,[FromQuery] string Name)
        {

            return _host.GetName(ID+":"+Name);
        }

        [HttpPost("Post")]
        public object Post([FromBody] jieshouDto Dto)
        {
            return Dto;
        }

        [HttpPost("useradd")]
        public object useradd([FromBody] UserDto User)
        {
            return _host.UserAdd(User);
        }
    }
}
